/* eslint valid-jsdoc: "off" */

'use strict';
const path = require('path');

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1593281995158_5465';

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    multipart: {
      mode: 'file'
    },
    cluster: {
      listen: {
        port: 8040
      }
    },
    weixin: {
      appid: 'wx434046c43594a391',
      secret: 'ee7257a3040e0b75fb503c9ff1bc4295',
      smsKey: 'r5XeOAabNU9SHEcVbH',
      smsURL: 'https://sms-gateway.lvmh-pc.cn/api/gue_pos_c01'
    },
    // myAppName: 'egg',
    mysql: {
      client: {},
      app: true
    },
    security: {
      csrf: {
        enable: false
      },
      domainWhiteList: []
    },
    cors: {
      origin: '*',
      allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS'
    },
    assetsURL: 'https://shyb888.cn/vip/2025/jiaolan',
    static: {
      prefix: '/public/',
      dir: path.join(appInfo.baseDir, 'upload'),
      dynamic: true,
      buffer: false
    }
  };

  return {
    ...config,
    ...userConfig
  };
};
